package com.quickfile.jrefilesystem;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.channels.FileChannel;

import com.quickfile.File;
import com.quickfile.FileOutputStream;

public class FileOutputStreamImpl extends FileOutputStream {

	private java.io.FileOutputStream fileOutputStream;

	public FileOutputStreamImpl(File file) throws FileNotFoundException {
		fileOutputStream = new java.io.FileOutputStream(((FileImpl) file).file);
	}

	public FileOutputStreamImpl(File file, boolean append)
			throws FileNotFoundException {
		fileOutputStream = new java.io.FileOutputStream(((FileImpl) file).file,
				append);
	}

	public FileOutputStreamImpl(String filepath) throws FileNotFoundException {
		fileOutputStream = new java.io.FileOutputStream(filepath);
	}

	public FileOutputStreamImpl(String filepath, boolean append)
			throws FileNotFoundException {
		fileOutputStream = new java.io.FileOutputStream(filepath, append);
	}

	@Override
	public void close() throws IOException {
		fileOutputStream.close();
	}

	@Override
	public FileChannel getChannel() {
		// TODO Auto-generated method stub
		return fileOutputStream.getChannel();
	}

	@Override
	public void write(byte[] b) throws IOException {
		fileOutputStream.write(b);
	}

	@Override
	public void write(byte[] b, int off, int len) throws IOException {
		fileOutputStream.write(b, off, len);
	}

	@Override
	public void write(int b) throws IOException {
		fileOutputStream.write(b);
	}
}
